package com.fessc.develop.job;

import com.fessc.develop.entity.dbvo.TPayment;
import com.fessc.develop.handler.CCBPrePaymentRefundPushHandler;
import com.fessc.develop.model.enums.EnumTaskCode;
import com.fessc.develop.service.interfaces.ITPaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class CCBPrePaymentRefundPushJob extends ScheduleJob{

    @Resource
    private ITPaymentService paymentService;

    @Resource
    private CCBPrePaymentRefundPushHandler ccbPrePaymentRefundPushHandler;

    @Override
    public String execute() {
        log.info("查询建行预付款退款待发送交易结果集");
        List<TPayment> paymentList = paymentService.getRefundPaymentByBankIdToPush(getCCBBankId(), getTaskTermDate(), "Y");
        ccbPrePaymentRefundPushHandler.refundPush(paymentList);
        return null;
    }

    @Override
    public String getTaskCode() {
        return EnumTaskCode.CCB_PRE_PAYMENT_REFUND_PUSH.toString();
    }
}
